//
//  AVGNetworkTool.swift
//  33-
//
//  Created by mac on 16/7/22.
//  Copyright © 2016年 mac. All rights reserved.
//

import UIKit

import  AFNetworking
//网络工具类直接继承
class AVGNetworkTool: AFHTTPSessionManager {
    //单利
    static let  shareNetworkTool:AVGNetworkTool =
    AVGNetworkTool(baseURL: NSURL(string: "https://api.weibo.com/2/"))
    //自己实现构造方法
    override init(baseURL url: NSURL?, sessionConfiguration configuration: NSURLSessionConfiguration?) {
        super.init(baseURL: url, sessionConfiguration: configuration)
        
        // 添加返回序列化器支持的类型
        self.responseSerializer.acceptableContentTypes?.insert("text/plain")
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}
